home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / iconal2a / colbarmo.bas < prev    next >
BASIC Source File  |  1999-10-13  |  6KB  |  163 lines

  1. Attribute VB_Name = "ColBarModule"
  2. Option Explicit
  3. Public Inp1, DefInp As String
  4. Public xx%, Idx%, IconIdx%
  5. Public Temp$, IBpath$, Inp$, Mess$
  6. Public Message(2) As Boolean
  7. Public r2, r3, g2, g3, b2, b3 As Integer
  8.  
  9. Public Sub MBox(MObj As Form, Mtxt As String, Mbut0 As String, Mbut1 As String, Mbut2 As String, Micon As Integer, Mtitle As String, MR As Integer, MG As Integer, MB As Integer, Mfont1 As String, Mfont2 As String, MposX As Integer, MposY As Integer)
  10. ' 1 = question
  11. ' 2 = info
  12. ' 3 = exlamation
  13. ' 4 = critical
  14. ' 5 = disk
  15. ' 6 = folder
  16. ' 7 = printer
  17. ' 8 = write
  18. ' 9 = trash
  19.  
  20. Message(0) = False
  21. Message(1) = False
  22. Message(2) = False
  23. With MObj
  24. .Label2.Width = 3300
  25. r2 = MR + 50: If r2 > 255 Then r2 = 255
  26. g2 = MG + 50: If g2 > 255 Then g2 = 255
  27. b2 = MB + 50: If b2 > 255 Then b2 = 255
  28. r3 = MR - 50: If r3 < 0 Then r3 = 0
  29. g3 = MG - 50: If g3 < 0 Then g3 = 0
  30. b3 = MB - 50: If b3 < 0 Then b3 = 0
  31.  
  32. .Label2.BackColor = RGB(MR, MG, MB)
  33. .Label3.BackColor = RGB(r3, g3, b3)
  34. .Picture1.BackColor = RGB(MR, MG, MB)
  35. .Pic1(0).BackColor = RGB(MR, MG, MB)
  36. .Pic1(1).BackColor = RGB(MR, MG, MB)
  37. .Pic1(2).BackColor = RGB(MR, MG, MB)
  38. .Label1(0).BackColor = RGB(MR, MG, MB)
  39. .Label1(1).BackColor = RGB(MR, MG, MB)
  40. .Label1(2).BackColor = RGB(MR, MG, MB)
  41. .Label1(0).ForeColor = RGB(MR Xor 255, MG Xor 255, MB Xor 255)
  42. .Label1(1).ForeColor = RGB(MR Xor 255, MG Xor 255, MB Xor 255)
  43. .Label1(2).ForeColor = RGB(MR Xor 255, MG Xor 255, MB Xor 255)
  44. .Label2.ForeColor = RGB(MR Xor 255, MG Xor 255, MB Xor 255)
  45. .Label3.ForeColor = RGB(r2, g2, b2)
  46. MObj.BackColor = RGB(MR, MG, MB)
  47. Dim qq As Integer
  48. For qq = 0 To 2
  49. .Label1(qq).Move 1, 1, .Pic1(qq).ScaleWidth - 2, .Pic1(qq).ScaleHeight - 2
  50. .Pic1(qq).Line (0, 0)-(.Pic1(qq).ScaleWidth - 1, .Pic1(qq).ScaleHeight - 1), RGB(r2, g2, b2), B
  51. .Pic1(qq).Line (0, .Pic1(qq).ScaleHeight - 1)-(.Pic1(qq).ScaleWidth - 1, .Pic1(qq).ScaleHeight - 1), RGB(r3, g3, b3)
  52. .Pic1(qq).Line (.Pic1(qq).ScaleWidth - 1, .Pic1(qq).ScaleHeight - 1)-(.Pic1(qq).ScaleWidth - 1, 0), RGB(r3, g3, b3)
  53. Next qq
  54. MObj.Cls
  55. .Label2.Caption = Mtxt
  56. .Label3.Font = Mfont1
  57. .Label1(0).Font = Mfont1
  58. .Label1(1).Font = Mfont1
  59. .Label1(2).Font = Mfont1
  60. .Label2.Font = Mfont2
  61. MObj.Move MposX, MposY, .Label2.Width + 1125, .Label2.Height + 1140
  62. If .Label2.Width + 1125 < 4500 Then MObj.Width = 4500
  63. .Label3.Move 45, 45, MObj.Width - 90, 300
  64. .Label3.Caption = "   " & Mtitle
  65. .Label1(0).Caption = Mbut0
  66. .Label1(1).Caption = Mbut1
  67. .Label1(2).Caption = Mbut2
  68. .Pic1(0).Top = MObj.Height - .Pic1(0).Height - 90
  69. .Pic1(1).Top = MObj.Height - .Pic1(0).Height - 90
  70. .Pic1(2).Top = MObj.Height - .Pic1(0).Height - 90
  71. .Picture1.Top = (MObj.Height / 2) - (.Picture1.Height / 2)
  72. .Picture1.Left = MObj.Width - 630
  73. .Picture1.Picture = .ImageList1.ListImages(Micon).Picture
  74. .Pic1(1).Visible = False
  75. .Pic1(2).Visible = False
  76. .Pic1(0).Left = (MObj.Width / 2) - (.Pic1(0).Width / 2)
  77.  
  78. If Mbut1 <> "" Then .Pic1(1).Visible = True
  79. If Mbut2 <> "" Then .Pic1(2).Visible = True
  80.  
  81. If Mbut1 <> "" And Mbut2 <> "" Then
  82. .Pic1(0).Left = (MObj.Width / 2) - .Pic1(0).Width - (.Pic1(1).Width / 2) - 45
  83. .Pic1(1).Left = (MObj.Width / 2) - (.Pic1(1).Width / 2)
  84. .Pic1(2).Left = (MObj.Width / 2) + (.Pic1(1).Width / 2) + 45
  85. End If
  86.  
  87. If Mbut1 <> "" And Mbut2 = "" Then
  88. .Pic1(0).Left = (MObj.Width / 2) - .Pic1(0).Width - 23
  89. .Pic1(1).Left = (MObj.Width / 2) + 23
  90. End If
  91. MObj.Line (15, 15)-(MObj.Width - 30, MObj.Height - 30), RGB(r2, g2, b2), B
  92. MObj.Line (15, MObj.Height - 30)-(MObj.Width - 30, MObj.Height - 30), RGB(r3, g3, b3)
  93. MObj.Line (MObj.Width - 30, MObj.Height - 30)-(MObj.Width - 30, 30), RGB(r3, g3, b3)
  94. MObj.Line (30, .Label3.Top + .Label3.Height)-(MObj.Width - 30, .Label3.Top + .Label3.Height), RGB(r3, g3, b3)
  95. MObj.Line (30, .Label3.Top + .Label3.Height + 15)-(MObj.Width - 30, .Label3.Top + .Label3.Height + 15), RGB(r2, g2, b2)
  96. End With
  97. MObj.Show 1
  98. End Sub
  99.  
  100. Public Sub InpBox(InpObj As Object, InpPrompt As String, Inp As String, InpTitle As String, InpFont As String, InpX As Integer, InpY As Integer)
  101.  
  102. With InpObj
  103. InpObj.Cls
  104. Inp1 = ""
  105. .Text1.BackColor = RGB(210, 255, 255)
  106. .Text1.ForeColor = RGB(0, 0, 128)
  107. .Text1.FontBold = False
  108. .Label2.BackColor = RGB(0, 96, 0)
  109. .Label2.Left = 30
  110. .Label2.Caption = InpTitle
  111. .Label1.Font = InpFont
  112. .Label2.Font = InpFont
  113. .Command2.Font = InpFont
  114. .Command3.Font = InpFont
  115. .Label1.Width = 3100
  116. .Label1.Caption = InpPrompt
  117.     If .Label1.Height <= 720 Then
  118.     InpObj.Move InpX, InpY, .Label1.Width + 1485, 1680
  119.     .Image1.Top = 405
  120.     Else
  121.     InpObj.Move InpX, InpY, .Label1.Width + 1485, .Label1.Height + 900
  122.     .Image1.Top = .Label1.Top + (.Label1.Height / 2) - 480
  123.     End If
  124. If InpObj.Width < 5010 Then InpObj.Width = 5010
  125. .Text1.Top = InpObj.Height - 450
  126. .Command3.Top = InpObj.Height - 345
  127. .Command2.Top = InpObj.Height - 645
  128. .Command3.Left = InpObj.Width - 1140
  129. .Command2.Left = InpObj.Width - 1140
  130. .Image1.Left = InpObj.Width - 915
  131. .Label2.Width = InpObj.Width - 75
  132. .Command1.Left = InpObj.Width - 360
  133. InpObj.Line (0, 0)-(InpObj.Width - 15, InpObj.Height - 15), RGB(128, 128, 128), B
  134. InpObj.Line (15, 15)-(InpObj.Width - 15, 15), RGB(255, 255, 255)
  135. InpObj.Line (15, 15)-(15, InpObj.Height - 15), RGB(255, 255, 255)
  136. InpObj.Line (15, InpObj.Height - 30)-(InpObj.Width - 30, InpObj.Height - 30), RGB(128, 128, 128)
  137. InpObj.Line (InpObj.Width - 30, 30)-(InpObj.Width - 30, InpObj.Height - 30), RGB(128, 128, 128)
  138. .Text1.Text = Inp
  139. .Text1.SelStart = 0
  140. .Text1.SelLength = Len(Inp)
  141. InpForm1.Show 1
  142. End With
  143. End Sub
  144.  
  145. Public Sub ColBar(Obj As Object, St%, H%, R%, G%, B%, RE%, GE%, BE%)
  146. Dim H2%, H3%, IvR%, IvG%, IvB%
  147. Obj.AutoRedraw = True
  148. Obj.ScaleMode = 3 'pixel
  149. H3 = Int(H / 2)
  150. IvR = Int(RE - R) / H3
  151. IvG = Int(GE - G) / H3
  152. IvB = Int(BE - B) / H3
  153. Do While H >= H3
  154. Obj.Line (0, St + H2)-(Obj.ScaleWidth, St + H2), RGB(R, G, B)
  155. Obj.Line (0, St + H)-(Obj.ScaleWidth, St + H), RGB(R, G, B)
  156. H = H - 1
  157. H2 = H2 + 1
  158. R = R + IvR
  159. G = G + IvG
  160. B = B + IvB
  161. Loop
  162. End Sub
  163.